package cate.game.activity.bosstrain;

import cate.common.table.d.GDFunc;
import cate.game.activity.bosstrain.msg.BossTrainChallengeResultResp;
import cate.game.play.proce.play.PlayPO;
import cate.game.role.Role;
import cate.game.role.farm.AbstractFarmFTC;

public class BossTrainFTC extends AbstractFarmFTC<BossTrainFight> {

    public BossTrainFTC(Role role, int funcId) {
        this.funcId = funcId;
        setup(role);
    }

    @Override
    protected BossTrainFight po(Role role) {
        BossTrainActivity single = role.getActivity().getEnableActivitySingle(funcId);
        return single.fight;
    }

    @Override
    public void handleResult(Role role, PlayPO playPO) {
        super.handleResult(role, playPO);
        double damage = playPO.teamEnd.b.getAllHero().get(0).performance.hurt;
        BossTrainActivity single = role.getActivity().getEnableActivitySingle(GDFunc.BOSS_TRAIN);
        single.fight.updateDamage(damage);
        BossTrainChallengeResultResp resp = new BossTrainChallengeResultResp(funcId, damage);
        role.sendNow(resp);

    }
}
